<template>
	<view class="p-20 bg-white pages">

		<!-- 标题 -->
		<view>
			<text class="fw fs-36">{{item.title || ''}}</text>
		</view>
		<!-- end -->

		<view class="mt-30 c-666 flex ac sb">
			<view>
				<text>{{$timer.formatTime(item.create_time,'yyyy-mm-dd')}}</text>
				<text class="ml-20">{{item.laber || ''}}</text>
			</view>
			<view>
				<text>阅读：</text>
				<text>{{item.number || 0}}</text>
			</view>
		</view>

		<!-- 富文本 -->
		<view class="mt-50">
			<jyf-parser :html="item.text.replace(/<br\/>/ig, '')" ref="article"></jyf-parser>
		</view>
		<!-- end -->

	</view>
</template>

<script>
	import {
		configMap
	} from "@/utils";
	import {
		mapGetters
	} from "vuex";
	import {
		platformDetail
	} from '@/api/extend.js'
	import parser from "@/components/jyf-parser/jyf-parser";
	export default {
		components: {
			"jyf-parser": parser,
		},
		computed: {
			...configMap({}, mapGetters(['isLogin', 'uid', 'userInfo'])),
			chamberObj() {
				return this.$store.state.extend.chamberObj
			},
		},
		// #ifdef MP
		onShareAppMessage: function() {
			wx.showShareMenu({
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline']
			})
			return {
				title: `${this.item.title}` || '',
				path: `pages/extend/index/index_news_desc?uid=${this.uid || -1}&id=${this.item.id}`,
			}
		},
		onShareTimeline: function() {
			return {
				title: `${this.item.title}`,
				query: {
					uid: this.uid,
					id: this.item.id,
				},
				imageUrl: ''
			}
		},
		// #endif
		data() {
			return {
				item: {
					text: ''
				},
			}
		},
		methods: {

		},
		onLoad(options) {
			platformDetail({
				id: options.id
			}).then(res => {
				this.item = res.data;
				uni.setNavigationBarTitle({
					title:res.data.title || '动态详情'
				})
			})
		}
	}
</script>

<style lang="scss" scoped>
	.pages {
		width: 100%;
		min-height: 100vh;
	}
</style>